High-level programming languages typically process English-like programming statements in one of two ways. The first way is known as compilation. Compilers perform a translation of the high-level language into machine language before the program is run. The result of this process is a file of machine code that is directly executable by the machine.
A second way is known as interpretation. Interpreted software languages are not translated into a form that is directly readable by the computer but are, instead, processed as data by an interpreter.
Compiled languages are usually faster than interpreted languages, because an interpreter or a virtual machine must typically process each high-level program statement each time it is executed, while a compiler need only translate each program statement once, after which the computer may execute the resulting code directly. Interpreted languages, however, are often easier to use and more powerful than compiled languages and so are often used to write smaller programs in which speed of program execution is not as important as speed and ease of writing the program.
In any programming language, whether compiled or interpreted, a variable's type denotes what kind of values it contains. Example variable types are integer, floating point, and text string. When a variable is static, it means the type is fixed or bound at compile time, and cannot thereafter be changed. When a variable is dynamic, it means that the type is not fixed or bound until run time, and therefore can change repeatedly during the course of program execution. Thus, dynamic typing refers to the property that a variable can adopt a type and change that type according to run-time demands.
In programming, static typing often allows better error detection, more work at compile time and hence faster execution times, while dynamic typing often allows greater flexibility, and easier to write (for example, no declaration statements) programs.